﻿// Decompiled with JetBrains decompiler
// Type: Netick.NetworkTransport
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

using System.Collections.Generic;

#nullable disable
namespace Netick;

public abstract class NetworkTransport
{
  public NetworkPeer NetworkPeer { get; internal set; }

  public NetickEngine Engine { get; internal set; }

  internal void InitInternal(NetworkPeer networkPeer, NetickEngine engine)
  {
    this.NetworkPeer = networkPeer;
    this.Engine = engine;
    this.Init();
  }

  public virtual void Init()
  {
  }

  public abstract void Connect(
    string address,
    int port,
    byte[] connectionData,
    int connectionDataLength);

  public abstract void Disconnect(TransportConnection connection);

  public abstract void Run(RunMode mode, int port);

  public abstract void Shutdown();

  public abstract void PollEvents();

  public virtual void ForceUpdate()
  {
  }

  public void OnMatchListUpdate(List<Session> sessions)
  {
    this.Engine._gameEngine.OnMatchListUpdate(sessions);
  }

  public virtual void UpdateMatchList()
  {
  }

  public virtual void HostMatch(string name)
  {
  }
}
